package com.common.BearMethods;

import com.common.BearBean.BaseListBean;
import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class GetBaseListMethods extends BaseMethods {

    private static GetBaseListMethods m_ins = null;

    public static GetBaseListMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetBaseListMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetBaseListMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "api/Lists/";
    }

    private BearService initService() {
        return getRetrofit().create(BearService.class);
    }


    public void     allLists       (Subscriber<BaseListBean> subscriber,
                      String uid ,
                      String hashid,
                      int page,
                      int type
    ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().allLists (time,
                SortUtils.getMyHash("time"+time,"uid"+uid,"hashid"+hashid ,"page"+page,"type"+type), Constans.ANDROID_APP_ID,"3",
              uid,hashid,page,type
        );
        toSubscribe(observable, subscriber);
    }
}
